<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件化</title>
</head>
<body>
<div id="app">
        name:{{name}}<br/>

    <heima63></heima63>
    <heima63></heima63>
    <heima63></heima63>
</div>

<script src="../node_modules/vue/dist/vue.js"></script>
<script>

    Vue.component("heima63", {
        template: `<div>
                我是一个全局的组件,<br/>
               name:{{name}}<br/>
               age:{{age}}<br/>
               address:{{address}}<br/>

               info:{{info}}<br/>

               <button @click="add">你点我啊</button>
               <hr/>
            </div>`,
        data() {
            return {
                name: "ldh",
                age:50,
                address:"中国上海浦东",
                info:18
            }
        },
        methods:{
            add() {
                this.info++;
            },
        },
        created(){
            alert("我是黑马63组件，我被创建好了");
        }
    })


    let app = new Vue({
        el: "#app",
        data: {
            name:"黑马"
        }
    });
</script>

</body>
</html>